package cn.juque.workflow.config;

import cn.juque.common.aop.ExceptionAspect;
import cn.juque.common.thread.BaseOperatorThreadLocal;
import cn.juque.common.utils.ValidatorUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author juque
 * @version 1.0.0
 * <ul>
 *     <li>WorkflowConfig</li>
 * </ul>
 * @date 2023-01-26 18:52:35
 **/
@Configuration
@ComponentScans(value = {@ComponentScan("cn.hutool.extra.spring"),@ComponentScan("cn.juque.common")})
public class WorkflowConfig implements WebMvcConfigurer {

    @Bean
    public ValidatorUtil validatorUtil() {
        return new ValidatorUtil();
    }

    @Bean
    public ExceptionAspect exceptionAspect() {
        return new ExceptionAspect();
    }

    @Bean
    public BaseOperatorThreadLocal baseOperatorThreadLocal() {
        return new BaseOperatorThreadLocal();
    }
}
